BlurEffect: drop render data on resume from sleep - #108
Open
xxmathias wants to merge 1 commit into
Open
Conversation
GPU memory is powered down across suspend/hibernate, so the cached blur textures and the TextureComparer's counter buffers / query objects can come back holding garbage. A stuck "no pixels changed" query then permanently wedges the conditional render and dirty region tracking: the effect keeps drawing the stale cached texture and never updates again (visible as frozen decorations, e.g. unclickable titlebar buttons, until the effect is reloaded). Listen for logind's PrepareForSleep on the system bus and drop all per-window render data on wake so textures, framebuffers, cache entries and compare state are rebuilt from scratch on the next paint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After resuming from suspend/hibernate, the effect can wedge into a state where it keeps drawing stale cached content and never updates again. Observed on a ThinkPad T14 (amdgpu, Plasma 6.7.2, Wayland,
BlurDecorations=true): after resume, window decorations stayed frozen at their pre-sleep pixels — titlebar buttons were visible but did not respond to clicks, because the on-screen titlebar no longer matched the live decoration. Unloading and reloading the effect via D-Bus cleared it, which pointed at stale per-window render state rather than config or KWin.Cause
GPU memory is powered down across suspend (and fully lost across hibernate/S4), so the cached blur textures and the
TextureComparer's counter SSBOs / query objects can come back holding garbage. A query stuck at "no pixels changed" permanently wedges the conditional render and dirty-region tracking: every paint takes the cached-only path and the stale texture is drawn forever. Nothing currently invalidates on resume — onlyviewRemoved/screenRemovedare handled.Fix
Subscribe to logind's
PrepareForSleepon the system bus and, on wake, drop every window'sBlurRenderData— dual-Kawase textures, framebuffers,BlurCacheLRUentry, and the compareWindowData— so everything is rebuilt from scratch on the next paint. Also adds the previously missing explicitQt6::DBuslinkage (it only linked because kwin already loads libQt6DBus).🤖 Generated with Claude Code